package testcase.card;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import satir.card.Card;

import satir.player.Player;

import junit.framework.TestCase;
/**
 * The Testing Class SatirGameTest_startGame.
 * 
 * @version 1.0 March 2012
 * @author Bill Chan
 * 
 */
public class Card_activateCard_1 extends TestCase {
	private final ByteArrayOutputStream outContent = new ByteArrayOutputStream(); 
	private final ByteArrayOutputStream errContent = new ByteArrayOutputStream(); 
	
	/**
	 * Sets up the test fixture.
	 * 
	 * Called before every test case method.
	 */
	@Before
	public void setUp() throws Exception {
		   System.setOut(new PrintStream(outContent));     
		   System.setErr(new PrintStream(errContent)); 
	}
	
	/**
	 * Tears down the test fixture.
	 * 
	 * Called after every test case method.
	 */
	@After
	public void tearDown() throws Exception {
		   System.setOut(null);     
		   System.setErr(null); 
	}

	/**
	 * Step number: 1 
	 * Goal: do the action of the doActiveCArd
	 */
	@Test
	public void testActivateCard() {
		class testStub extends Card{
			@Override
			protected void doActivateCard(Player p) {
				System.out.print("testing1");
			}
			@Override
			protected void afterActivateCard() {
				System.out.print("testing2");
			}

		}
		testStub t=new testStub();
		t.activateCard(new Player());
		assertEquals("testing1testing2", outContent.toString());

	}
}